02 - Computer-Aided Design
Modelling in 2D and 3D
This weeks topics is titled "Computer-Aided-Design" (CAD), where computers are used to create, modify, analyze and optimize designs. In order to make use of it, the assignment for this week was to explore different approaches for modelling, in both 2D and 3D, and upload the design files. Furthermore, for documentation purposes we were asked to learn how to compress images and videos. The tasks were:
- Model (raster, vector, 2D, 3D, render, animate, simulate, ...) a possible final project
- Compress your images and videos
- Post a description with your design files on your class page
Modelling in 2D
In 2D modelling, there are two different types of graphics, namely raster and vector graphics. While raster graphics, like .png or .jpg, consist of two-dimensional grids of pixels, vector graphics, like svg., comprises geometric shapes defined by mathematical equations. Due to this, vector graphics can be scaled infinitely without loosing quality, but raster graphics cannot.
Working with Raster Images
For editing raster images, GIMP is an appropriate choice as it is very powerful and a free and open-source software. I have used it many times and I really enjoy it but I have only used the very basic tools to edit some photos. However, to be more professional and get to know what it can do, I watched a GIMP tutorial on YouTube.
In order to now apply what I learned, I wanted to model something with this software. However, I didn't know what aspect of my final project I could use it for. Therefore, I decided against modelling something for my final project, but for a different assignment. In this case, I found an appropriate task already in next week's assignment for Computer-Controlled Cutting. In order to cut something on the vinyl cutter, I need an image of what I want to cut. I decided I want to cut something that I drew on a sheet of paper for practicing image processing with raster and vector graphics. The task I set for myself therefore was to extract the outline of the drawing and create a path from it.
I started by drawing the outline of a frog with a green felt-tip pen on a white sheet of paper. The pen however was quite inconsistent and the color of the stroke varies. Additionally, the white of the paper does not appear as a purely white background.
Hence, the goal for editing this photo with GIMP were two things:
- Remove the background
- Uniform color of the outline
As the photo is a raster image, I am using GIMP for editing. After opening the program, I dragged the photo of the drawing from the explorer and dropped it into GIMP:
Firstly, I wanted to remove the background and make it transparent. In order to allow for transparency, I had to add the alpha channel by clicking Layer > Transparency > Add Alpha Channel. Then, I selected the background by using the fuzzy select tool of the toolbox, also called "magic wand" as the icon looks like one. It automatically selects an area of the current layer or image based on the similarity to the color the user selected by clicking on a certain spot in the image. By doing this, I discovered, that the tool did not select the whole background. Especially, the parts in the bottom right corner where the background is darker were not selected. You can see it in the image as the bottom right corner is striped which shows the outline of the selection.
In order to fully select the background but not the outline, also areas with colors that are less similar to the initially selected color had to be selected. This can be adjusted with the option "threshold" for the fuzzy select tool. In the beginning, it was set to 20.
Hence, I increased the threshold to 40. However, this was still not sufficient. Therefore, I increased it even more, to 100.
In the end, I stayed with a threshold value of 100 as higher values resulted only in selecting parts of the outline. With this threshold, I selected two areas, the part outside of the outline and the part inside of it. By pressing the delete key, I removed the selected area and was left with the outline.
This accomplished the first goal for editing the photo: removing the background. The second was to uniform the color of the outline. This can be very easily achieved with the pencil tool as it only colors on the selection. As I still had the areas of the background and the infill selected, I simply inverted the selection by clicking Select > Invert or Ctr+I. With this, I then had the outline selected and was able to draw only on the outline. After increasing the brush size to 1000 and setting the foreground color to a green of my choice, I dragged it over all parts of the outline giving it a uniform color:
Drawing over the Selected Outline in GIMP
One very important aspect however is, to export the image in a format that supports transparency, like .png for example. But in total, with these steps, I got from the photo on the left, to the image on the right with a transparent background!
Working with Vector Graphics
To create or edit vector graphics, I chose Inkscape. Similar to GIMP, it is a powerful, free and open-source software which I have used previously. However, in case I wanted to draw something, I have always chosen Inkscape over GIMP due to the advantage of vector graphics. Nevertheless, I again watched videos on YouTube, this time an Inkscape tutorial from the same channel as the GIMP tutorial that I watched earlier.
For sketching something like the outline of the frog drawn on a sheet of paper, GIMP was not very complicated. However, when zooming in on the picture, e.g. on the left hand, the outline appears relatively fuzzy. In order to get rid of this, my goal for using Inkscape today is:
- Convert the outline to an vector element
- Smoothen the shape
I got started by opening Inkscape, dragging the .png file I obtained from GIMP and dropped it into Inkscape. Compared to the page size, the image was enormous. Hence, the first step was to adjust the size of the image as well as of the page. For the latter, I opened the document properties via File > Document Properties... and set the page to a custom size of 1280 x 1024 px (w x h). Additionally, I resized the picture of the outline by dragging the bottom right corner closer to the top left while pressing Ctrl in order to maintain the aspect ratio of the image. This is how it looked afterwards.
Next, I wanted to convert the shape into a vector element. For this, I selected the image and used Path > Trace Bitmap. Another dialog opened where I was able to adjust the setting for this tool. Here, I used the settings you can see in the image.
Tracing the bitmap with these settings gave me a path as shown in the picture. As you can see, there are very many nodes in this shape. Additionally, is also traced some areas in the bottom right corner where it was difficult in GIMP not to select this area with the fuzzy select tool. I manually deleted these nodes wherever I found a mistake by selecting these nodes and hitting the delete key.
After finishing it, I went on to the last goal to achieve with Inkscape: Smoothen the shape. This can be done by either going to Path > Simplify or by pressing Ctrl + L. What happens is, that some nodes on the path are removed. The more often this is applied, the stronger the simplification is and the more nodes are removed. You can see this in the video below, where I applied the simplification several times and then undid it.
In the end, I decided to apply the simplification five times as I really liked, that the paths were pointy in some places and of unequal thickness. I also gave its filling a different color for visualization purposes. This is how it looked in the end:
Using Inkscape Only
The first step, i.e. removing the background in GIMP (see above) is however not necessary as the "Trace bitmap" tool of Inkscape is powerful enough to detect the lines. For this, I directly imported to photo of the drawing into Inkscape and traced the bitmap with the settings as shown in the image. This worked really well but unfortunately, the area between the outside and inside path had some "holes".
I fixed the holes by splitting the path into individual paths via Path > Break Apart. This created many paths, one along the outside, one along the inside and one for each "hole". Then I selected only the outside and inside path and pressed Path > Union. This resulted in a consistent outline without holes. The remaining paths I simply deleted by selecting all objects with Ctrl+A, unselecting the outline and then using the delete key. In the end, I simplified the path of the outline with Ctrl+L three times. This method resulted in a slightly different shape than the one with GIMP preprocessing.
In total, using GIMP is not necessary for this application. Instead, using Inkscape only takes definitely less time and results in a vector graphics of at least the same quality.
Modelling My Final Project in 3D: CAD with Autodesk Fusion 360
3D Modelling can be more complex than 2D modelling but there are various programs. Many of them are very capable and have an enormous set of tools. Among the most popular ones are FreeCAD, OpenSCAD, Blender, Autodesk Fusion 360, Autodesk Inventor and Solidworks.
In my undergraduate study programm, I learned how to prototype with Autodesk Inventor and it is still my preference. Since then, I have improved my skills in 3D CAD a lot and are very comfortable with it. In later works, I have also used Fusion and Solidworks which were however not as familiar and I went back to Inventor. However, for FabAcademy, Inventor might not be the best choice. My instructor for example has recommended Fusion and I agree that it really is a good choice for FabAcademy.
In comparison to Inventor, Fusion has almost the same tools available and a similar naming as they are both from the same company Autodesk. However, Fusion has a lot to offer when it comes to fabrication. Additionally, the cloud-based feature of Fusion makes it easy to collaborate which I will have to do in the following weeks for group assignments or in case I need support during the design from my instructor or others. Hence, I chose to do this assignment in Fusion.
During the local lecture, our instructor gave us a really good tutorial for Fusion and I felt relatively confident as I knew Autodesk Inventor quite well. Hence, I did not watch tutorials for Fusion but started right with designing.
Modelling Individual Components on the Rotating Shaft
For the final project, as sketched in the planning section on the page for the first assignment or the documentation for my final project, I will need several components, namely parts that position the LED strip on the side of the glass plate, that fix the glass plate to a frame and a structure to mount the frame to the rotating shaft. These are:
- Glass Plate: Dimensions 300 x 200 x 8 mm (w x d x h)
- 3D Printed Profile: Positioning of LED strip, fixing glass to more rigid structure
- Lasercut Frame: Two sheets sandwiching the 3D printed profile
- Rotating Shaft: Diameter 10 mm
- Shaft Mount: Mounting shaft to lasercut frame
Parametric Design
In case the dimensions change, the design should be parametric. Then, the designer only has to change the value of a single parameter and does not need to adapt all sketched dimensions. Hence, before modelling anything in Fusion, I added parameters. This can be done in the parameters window (Modify > Change Parameters) by clicking on the "+" (Add) button. This opens another window, where the name, the expression (value) and a comment for descriptions can be inserted. The parameter is then added to the list of user parameters by pressing ok.
By this, I added several different parameters. Their names, values and a descriptive commentes are shown below.
Glass Plate
First, I started modelling the glass plate. For this, I used the "Box" tool in the "Create" dropdown menu. This opened a dialog, which you can see on the right in the image. Here, I was able to adjust the length, width and height of the box and assigned them the value of the parameters for the depth, width and height of the glass plate , namely d_glass, w_glass and h_glass, respectively.
3D Printed Profile
After finishing the glass plate, I started modelling the 3D printed profile that should attach the LED strip to the sides of the glass plate but also allowed for attaching the glass plate to a frame. for this, I decided to design two different profiles, one for the short side and one for the long side of the glass plate. These profiles would then be connected on the ends with screws through overlapping parts of the profile.
For the profile on the long side of the glass plate, I started by creating a sketch in the XY plane, that had roughly the shape of the cross section of the profile. Next, I added horizontal and vertical constraints and subsequently the parametric dimensions. Due to this, the shaped changed. For example, the conical opening disappeared as the parameter for the height of the LED strip and the glass is the same. Additionally, the thickness of the bulk on the left increased significantly to 12 mm as it must allow for M6 screws being inserted through it from top to bottom.
Then, the profile of the sketch was extruded by the width of the glass plate (the dimension of the long side) with two times the width of the LEDs added to it resulting in a length of 306 mm. Twice the width of the LEDs were added as the profile must not only allow for the glass plate to fit into it but also the LED strip on either sides of the glass plate.
However, when mounting this profile to all sides of the glass plate, they would overlap on top of and below the corners of the glass plate. Therefore, a 45 degree cut must be done at these places, which I achieved by using creating a chamfer of the type "Equal Distance". This distance was set to be the overlap of the print over the glass plate plus the width of the LEDs, i.e. a distance of 5.5 mm.
Next, the connection between the profiles on all sides need to be designed. This connection should be achieved by finger-like interwoven or overlapping parts on the ends of the extruded profile. The profile on the long side of the glass plate should incorporate one extrusion in the middle which is sandwiched by two outer fingers from the profile on the short side. To design these, I added a sketch on both ends of the extruded profile which consists of three rectangles, one for each finger. For the current part, the middle rectangle was extruded to a length of 12 mm determined by the parameters for the screw diameter and twice the wall thickness of the 3D print.
Lastly, to allow this connection to be permanent and not only rely on friction between the fingers, the fingers are traversed by a screw fixing their interwoven position. For this, I added a point in a sketch positioned on the side of the profile which was centered on the side of the extruded finger. This point was then used to add a cylindrical hole which extents through "All" with a diameter set by the parameter referring to the diameter of the screws. This was repeated for the other end of the profile.
Above, the design and construction of the profile for the long side of the glass plate is described. In order to obtain the profile for the short side, the procedure was more or less repeated. However, there were two deviations. Firstly, the initially extruded profile was not extruded to 306 mm but 206 mm which result from the decreased length of the side. Secondly, instead of extruding the middle rectangle for generating the finger-like overlapping parts, the two outer rectangles were extruded.
In total, with the steps above, two profiles were designed, one for the long and one for the short side of the glass plate. They differ in length and in the design of the end connections such that they build a finger joint which can be fixed by inserting a screw through the cylindrical hole.
Lasercut Frame
The lasercut frame should sandwich the 3D printed profiles and should be attached to it via the same screws that are used to join the profiles on the ends. Hence, I started constructing the lasercut frame by adding a rectangle in the construction mode with the width and depth of the glass plate. Then, I added two rectangles to it, on in the inside of it, one on the outside. Their dimensions were mainly determined by the distance to the glass plate's rectangle.
The inner rectangle was evenly spaced by the parameter for the overlap of the 3D print on the glass plate. The sides of the outer rectangle were then fixed in a distance of 20 mm from the sides of the inner rectangle given by the parameter for the minimum width of the lasercut material. The top and bottom ends were positioned such that the lasercut material protrudes 20 mm from the 3D printed profile, which is equivalent to the value of the parameter indicating the insertion length of the shaft. In total, this results in a distance of 35 mm between the edge of the outer rectangle and the edge of the rectangle representing the glass plate. Due to this, the lasercut frame can not only be attached to the 3D printed profiles but furthermore to structures for mounting the rotating of the shaft on the top and bottom end.
The generated profile was then extruded to a thickness of the lasercut material as set with the respective parameter.
Next, I added four points, one next to each inner corner according to the position where the holes of the 3D printed profiles are expected. These four points were then used to make cylindrical holes through the complete material.
Then, I added fillets to the corners of the frame.
Lastly, I had to add some holes, where a shaft mounting structure can be attached to. The shaft should be inserted into a structure positioned between the protruding parts of the lasercut frame. This structure is intended to be fixed by two screws on either side of the shaft. Hence, I started by constructing a symmetry line (here shown by the vertical line). The distance between the points on either side of the symmetry line is then determined by the diameter of the shaft plus two times the wall thickness of 3D printed structures and plus the diameter of the screws. The space between the points on either sides is given by half of the shaft's insertion length and the distance between the outermost point and the border line by a quarter.
In total, with the steps above, a laser cut frame was designed that sandwiches and fixes the 3D printed profiles and furthermore allows to attach shaft mounting structures to it.
Rotating Shaft
The rotating shaft was easily design in Fusion by extruding a circle. In a sketch on the XY plane, I drew a circle with the diameter of the shaft. This profile was then extruded to a length of four times the insertion length.
Shaft Mount
The part to mount the shaft should consist of two halves that are compressed onto each other by screws and thus fix the shaft between them. Additionally, it should be sandwiched by the lasercut frame to position it. Hence, I started by drawing a sketch on the XY plane, that consist of a rectangle and a circle. The rectangle has a height of half the profile that sits on the side of the glass frame between the lasercut frames. The width of the rectangle is chosen by a combination of parameters such that the screws for fixing the part between the lasercut frames can traverse the part with sufficient wall thickness left on either side. The midpoint of the circle is furthermore placed on the middle of the bottom side of the rectangle as shown by the triangle which indicates a "MidPoint" constraint.
From the profile of the rectangle the protruding half of the circle is subtracted and then extruded to the insertion length of the shaft.
Lastly, cylindrical holes for the screws must be created. For this, I positioned four points on the inner face of the point according to position of the holes in the lasercut frame (see above). These are placed symmetrically onto the face, here symmetric to the horizontal and vertical symmetry axis. With these points, I lastly created cylindrical holes with a diameter of the screws extending through "All".
In total, these steps resulted in one half of the shaft mount part. By duplicating the part, the complete part is obtained that allows for fixing the shaft but also for being fixed on the lasercut frame with four screws. Due to its structure, these parts must be 3D printed as well.
Assembly of the Individual Components
Above, the individual components were designed and next is the assembly. However, some steps have to be completed previously to prepare the assembly.
Preparing the Assembly
As a first step, I added appearances to each body depending on the material. By right-clicking on a body in the browser on the left and selecting "Appearance", an additional window opens. In there, I chose the material from the folders in the bottom and added it to "In This Design" by drag and drop. An individual body was assigned an appearance by dragging and dropping the appearance from the "In This Design" section onto the body. By this, I gave the profiles and the shaft mounting part the appearance "Tough 2000 (with Formlabs SLA 3D Printers)", the shaft "Stainless Steel - Polished", the glass plate "Glass - Window" and the lasercut frame "Oak (End Grain)".
Next, some bodies had to be duplicated. This was achieved by copying and pasting the original body and moving the duplicate by pressing the key "M" and dragging it to a different position. With this procedure, I duplicated the two profiles, the lasercut frame, the rotating shaft and the complete shaft mounting part with its two halves. In total, the following bodies were created:
Lastly, components had do be created from the bodies. This is done by selecting all bodies, right-clicking and selecting "Create Components from Bodies". The created components can then be assembled.
The Assembly
For the assembly of all components, I started with joining the profiles on the side of the glass plate. I added a joint by clicking Assemble > Joint and selecting the midpoint in the inner side of the profile and the midpoint on the according face of the glass plate.
By this, the two selected midpoints were moved onto each other, but at an angle. Therefore, I had to adjust it by rotating the profile to zero degrees. Additionally, the profile should leave space for the LED strip. Hence, I furthermore moved the profile away from the glass by the width of the LED strip determined by the parameter w_LED.
I repeated these step for all four profiles such that all profiles were placed at the desired position.
Next, I added the joint between the lasercut frame and the profiles. For this, I selected the midpoint in the bottom of the cylindrical hole on the lasercut frame and the midpoint in the top of the cylindrical hole on the profile as shown in the images. By this, the two components were position as desired.
I repeated these step for the second lasercut frame on the other side of the profiles. By this, I obtained the following assembly:
Next, I joined the two halves of the shaft mounting halves with the lasercut frame(s). For this joint, I selected a point on one of the cylindrical holes on the shaft mounting part and the according point in the cylindrical hole on the lasercut frame. This resulted in the desired connection.
I repeated this connection with the other shaft mounting part. On both sides, the shaft mount was fixed in this position:
Lastly, I attached the shaft to the shaft mounting part by selecting the midpoint of the circular face on the shaft and the midpoint on the back of the according profile through the hole in the shaft mounting part
With the steps described above, the assembly was done. The completed version looks now like this:
Rendering of the Assembled Components
With the individuals components being assembled, I wanted to capture a rendered image of it. For this, I changed the workspace from "Design" to "Render". Then I simply zoomed in on the components and clicked on "Render" in the toolbar. This opened a dialog for the render settings. Here, I chose a Web application with 1.3 megapixel as a resolution, the local renderer and a quality of "Final (75)". After clicking on "Render" the rendering of the image started. After it completed, I downloaded the image and ready was the shot. I think it still is slightly noise but sufficiently good:
Animation of the Rotation
As a very last step for this assignment, I wanted to animate the rotation of the shaft. For this, I firstly changed the workspace from "Design" to "Animation" in the toolbar. This displayed a different set of tools that I have never worked with. Hence, I tried to look for a solution on YouTube and I found this video which was very helpful.
I started to design the animation by going to a time of five seconds in the animation timeline which is equivalent to the end of the animation. Then, I right-clicked on the group of components and selected "Transform Components". This opened a dialog, where I had to select a pivot point. I set it to be the midpoint of the outer face of one of the shafts. Then, I added a rotation by clicking on the desired rotation and inputting an angle of 180 degrees.
Lastly, I clicked on "Publish" and saved a video of the animation with the default settings on my computer. This is the result:
Animation of the Rotating Shaft
Evaluation of Fusion 360 vs. Inventor
In total, I am really surprised by how easy it was to design, assemble, render and animate in Fusion 360. I had not really seriously used another 3D CAD software other than Autodesk Inventor until last week. Although the structure like the toolbar and the names of the tools are very similar, the procedure to design parts can be much easier.
Not every step in designing varies between Inventor and Fusion. Sketching, extrusions and similar tools work very similarly. However, especially the assembly of multiple parts can be complicated in Inventor. Snapping of the selection to prominent points like midpoints or corners is not always present. Even if the selection works well, building the joint sometimes causes errors which I did not encounter in Fusion.
Additionally, it is very uncommon to design multiple parts in a single file in Inventor, in contrast to Fusion. There is a difference in the file format for files with a single part (.ipt) and for assemblies (.iam) in Inventor. However, this sometimes complicates the design process as the user has to shift between multiples files.
Similarly, the timeline in Fusion is really helpful. In Inventor, this is only a series of steps but shifting one design step to an earlier time is relatively unstable and a lot of error are caused. Not so in Fusion: I was able to shift all features to times as I desired without any errors.
Lastly, the cloud-based feature of Fusion is convenient. Instead of saving the files locally and creating multiple versions, the design files can easily be saved as a different version without causing chaos.
In total, I am really surprised by Fusion. I did not expect it to be so easy to adapt to this software. I really look forward to designing more and getting to know the program even better.
Design Files for Download
- Initial Image (.jpg): Photo of the drawn outline of the frog
- GIMP Output Image (.png): Raster graphics from initial image with transparent background and consistent outline
- GIMP + Inkscape Output Image (.svg): Vector graphics from image edited in GIMP
- Inkscape Output Image (.svg): Vector graphics from initial image
- Fusion 360 Design File (.f3d): Assembly of individual components designed in Fusion 360
- Rendered Image (.jpg): Rendering of the assembled components
- Animated Video (.mp4): Animation of the rotating shaft
Image and Video Compression
When documenting on a website, it is crucial to limit the size of it. For this, image and video compression are necessary. There are various methods and tools that can be used. However, below, I present the ones that are the most convenient for me.
Image Compression
For image compressing, I use a plugin for GIMP, called BIMP for Batch Image Manipulation Plugin. As I started using it already for last week, I have described it on that week's documentation page in the documentation section.
Video Compression
Video compression is relatively new to me as I have only done some video clipping so far. However, the software that I have been using, namely the free and open source program called Kdenlive, allows to compress videos once you render the project. Hence, I made use of that as I anyways had to clip the videos that I obtained during the documentation.
I start clipping by dragging the video, that I want to clip and compress, from the Windows explorer and drop it into the project bin. Then, the clip opens in the clip monitor, where I go to the frame that should be the first frame of the clip. After hitting the "Set Zone In" button in the bottom, I go to the desired end frame and use the "Set Zone Out" button. By right-clicking on the video in the clip monitor, the clipped zone can be extracted and is then available for more editing in the project bin, e.g. for increasing the speed.
The extracted and potentially edited zone can then be compressed by dragging it into the project such that it can be rendered (Project > Render). By this, another window pops up, where the user can adjust the render setting. In order to compress, the video can be resized or rescaled and the quality can be customized. Here, I have used a size of 1280 x 674 and a quality of 80. Then, with "Render to File", the clipped and compressed video is saved in the specified output folder.